import cv2
import numpy as np

img=cv2.imread(r'CV-Pictures/036.jpg')
cv2.imshow('img',img)
h,w=img.shape[:2]
x_h=int(h/2)
y_w=int(w/2)
M=cv2.getRotationMatrix2D((x_h,y_w),-45,0.8)
dst=cv2.warpAffine(img,M,(h,w))
cv2.imshow('rotate',dst)


cv2.waitKey(0)
cv2.destroyAllWindows()